<template>
  <view>
    <cover-view :style="{ top: StatusBarRpx + 20 + 'rpx' }" @click="back" class="close fu-iconfont2">&#xE794;</cover-view>
    <!-- #ifdef H5 -->
    <iframe
      :src="webPath"
      width="100%"
      frameborder="0"
      allowfullscreen="true"
      webkitallowfullscreen="true"
      mozallowfullscreen="true"
      style="display: block; height: 100vh"
    ></iframe>
    <!-- #endif -->
    <!-- #ifndef H5 -->
    <web-view v-if="webPath" :src="webPath"></web-view>
    <!-- #endif -->
  </view>
</template>

<script>
export default {
  data() {
    return {
      webPath: '',
    }
  },
  onUnload() {},

  onLoad({ webPath, params }) {
    if (webPath !== undefined) this.webPath = decodeURIComponent(webPath)
    console.log('params', params)
    if (params !== undefined) this.webPath = uni.getStorageSync('zhongbenjiaoyuPath')
  },
  methods: {
    back() {
      uni.navigateBack()
    },
  },
}
</script>

<style scoped>
.close {
  position: fixed;
  left: 20rpx;
  color: #fff;
  z-index: 9999;
  font-size: 50rpx;
  width: 60rpx;
  height: 60rpx;
  line-height: 60rpx;
  text-align: center;
  color: #333;
  font-size: 32rpx;
  z-index: 99;
}
</style>
